@extends('master') @section('content')
<div class="management-content">
    <div class="container">
        <div class="record-list management-order">
            @if(Session::get('message'))
            <div class="alert alert-info" role="alert">{{ Session::get('message') }}</div>
            @endif @if(Session::get('error'))
            <div class="alert alert-danger" role="alert">{{ Session::get('error') }}</div>
            @endif @if(count($orders) != 0)
            <h2>我的订单</h2>
            <table class="table">
                <thead>
                    <tr>
                        <th>图片</th>
                        <th>图片信息</th>
                        <th>价格</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                    @foreach ($orders as $order)
                    <tr>
                        <td>

                            <img src="{{ '/uploads/picture/' . $order->products[0]->thumb }}" alt="">
                        </td>
                        <td>
                            <ul>
                                @foreach($order->products as $picture)
                                <li>
                                    <img src="{{ '/uploads/picture/' . $picture->thumb }}" alt="">
                                </li>
                                @endforeach
                            </ul>
                        </td>
                        <td>
                            ¥ {{ $order->price }}
                        </td>
                        <td>
                            <a href="/order/info/{{ $order->id }}" class="btn btn-sm btn-primary"><i class="glyphicon glyphicon-credit-card"></i> 支付</a>
                            <a href="/order/delete/{{ $order->id }}" class="btn btn-sm btn-danger"><i class="glyphicon glyphicon-trash"></i> 取消订单</a>
                        </td>
                    </tr>
                    @endforeach
                </tbody>
            </table>



            @else
            <div class="alert alert-danger" role="alert">没有任何记录！ <a href="/picture/fresh" class="alert-link">挑选</a>
            </div>
            @endif


        </div>

    </div>
</div>
@stop




